<?php


/**
 * Base class that represents a query for the 'employee_evaluations' table.
 *
 *
 *
 * @method EmpevalEmployeeEvaluationsQuery orderByUserId($order = Criteria::ASC) Order by the user_id column
 * @method EmpevalEmployeeEvaluationsQuery orderByBonusGoalsFormId($order = Criteria::ASC) Order by the bonus_goals_form_id column
 * @method EmpevalEmployeeEvaluationsQuery orderByYear($order = Criteria::ASC) Order by the year column
 * @method EmpevalEmployeeEvaluationsQuery orderByEvaluationId($order = Criteria::ASC) Order by the evaluation_id column
 * @method EmpevalEmployeeEvaluationsQuery orderByStatus($order = Criteria::ASC) Order by the status column
 * @method EmpevalEmployeeEvaluationsQuery orderByActive($order = Criteria::ASC) Order by the active column
 * @method EmpevalEmployeeEvaluationsQuery orderByLastModified($order = Criteria::ASC) Order by the last_modified column
 * @method EmpevalEmployeeEvaluationsQuery orderByCreated($order = Criteria::ASC) Order by the created column
 *
 * @method EmpevalEmployeeEvaluationsQuery groupByUserId() Group by the user_id column
 * @method EmpevalEmployeeEvaluationsQuery groupByBonusGoalsFormId() Group by the bonus_goals_form_id column
 * @method EmpevalEmployeeEvaluationsQuery groupByYear() Group by the year column
 * @method EmpevalEmployeeEvaluationsQuery groupByEvaluationId() Group by the evaluation_id column
 * @method EmpevalEmployeeEvaluationsQuery groupByStatus() Group by the status column
 * @method EmpevalEmployeeEvaluationsQuery groupByActive() Group by the active column
 * @method EmpevalEmployeeEvaluationsQuery groupByLastModified() Group by the last_modified column
 * @method EmpevalEmployeeEvaluationsQuery groupByCreated() Group by the created column
 *
 * @method EmpevalEmployeeEvaluationsQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
 * @method EmpevalEmployeeEvaluationsQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
 * @method EmpevalEmployeeEvaluationsQuery innerJoin($relation) Adds a INNER JOIN clause to the query
 *
 * @method EmpevalEmployeeEvaluationsQuery leftJoinBonusGoalsForms($relationAlias = null) Adds a LEFT JOIN clause to the query using the BonusGoalsForms relation
 * @method EmpevalEmployeeEvaluationsQuery rightJoinBonusGoalsForms($relationAlias = null) Adds a RIGHT JOIN clause to the query using the BonusGoalsForms relation
 * @method EmpevalEmployeeEvaluationsQuery innerJoinBonusGoalsForms($relationAlias = null) Adds a INNER JOIN clause to the query using the BonusGoalsForms relation
 *
 * @method EmpevalEmployeeEvaluationsQuery leftJoinViewBgfWithSuperiorPositionId($relationAlias = null) Adds a LEFT JOIN clause to the query using the ViewBgfWithSuperiorPositionId relation
 * @method EmpevalEmployeeEvaluationsQuery rightJoinViewBgfWithSuperiorPositionId($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ViewBgfWithSuperiorPositionId relation
 * @method EmpevalEmployeeEvaluationsQuery innerJoinViewBgfWithSuperiorPositionId($relationAlias = null) Adds a INNER JOIN clause to the query using the ViewBgfWithSuperiorPositionId relation
 *
 * @method EmpevalEmployeeEvaluationsQuery leftJoinUsers($relationAlias = null) Adds a LEFT JOIN clause to the query using the Users relation
 * @method EmpevalEmployeeEvaluationsQuery rightJoinUsers($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Users relation
 * @method EmpevalEmployeeEvaluationsQuery innerJoinUsers($relationAlias = null) Adds a INNER JOIN clause to the query using the Users relation
 *
 * @method EmpevalEmployeeEvaluationsQuery leftJoinEvaluations($relationAlias = null) Adds a LEFT JOIN clause to the query using the Evaluations relation
 * @method EmpevalEmployeeEvaluationsQuery rightJoinEvaluations($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Evaluations relation
 * @method EmpevalEmployeeEvaluationsQuery innerJoinEvaluations($relationAlias = null) Adds a INNER JOIN clause to the query using the Evaluations relation
 *
 * @method EmpevalEmployeeEvaluationsQuery leftJoinEmployeeEvaluationValues($relationAlias = null) Adds a LEFT JOIN clause to the query using the EmployeeEvaluationValues relation
 * @method EmpevalEmployeeEvaluationsQuery rightJoinEmployeeEvaluationValues($relationAlias = null) Adds a RIGHT JOIN clause to the query using the EmployeeEvaluationValues relation
 * @method EmpevalEmployeeEvaluationsQuery innerJoinEmployeeEvaluationValues($relationAlias = null) Adds a INNER JOIN clause to the query using the EmployeeEvaluationValues relation
 *
 * @method EmpevalEmployeeEvaluations findOne(PropelPDO $con = null) Return the first EmpevalEmployeeEvaluations matching the query
 * @method EmpevalEmployeeEvaluations findOneOrCreate(PropelPDO $con = null) Return the first EmpevalEmployeeEvaluations matching the query, or a new EmpevalEmployeeEvaluations object populated from the query conditions when no match is found
 *
 * @method EmpevalEmployeeEvaluations findOneByUserId(int $user_id) Return the first EmpevalEmployeeEvaluations filtered by the user_id column
 * @method EmpevalEmployeeEvaluations findOneByBonusGoalsFormId(int $bonus_goals_form_id) Return the first EmpevalEmployeeEvaluations filtered by the bonus_goals_form_id column
 * @method EmpevalEmployeeEvaluations findOneByYear(int $year) Return the first EmpevalEmployeeEvaluations filtered by the year column
 * @method EmpevalEmployeeEvaluations findOneByEvaluationId(int $evaluation_id) Return the first EmpevalEmployeeEvaluations filtered by the evaluation_id column
 * @method EmpevalEmployeeEvaluations findOneByStatus(int $status) Return the first EmpevalEmployeeEvaluations filtered by the status column
 * @method EmpevalEmployeeEvaluations findOneByActive(boolean $active) Return the first EmpevalEmployeeEvaluations filtered by the active column
 * @method EmpevalEmployeeEvaluations findOneByLastModified(string $last_modified) Return the first EmpevalEmployeeEvaluations filtered by the last_modified column
 * @method EmpevalEmployeeEvaluations findOneByCreated(string $created) Return the first EmpevalEmployeeEvaluations filtered by the created column
 *
 * @method array findByUserId(int $user_id) Return EmpevalEmployeeEvaluations objects filtered by the user_id column
 * @method array findByBonusGoalsFormId(int $bonus_goals_form_id) Return EmpevalEmployeeEvaluations objects filtered by the bonus_goals_form_id column
 * @method array findByYear(int $year) Return EmpevalEmployeeEvaluations objects filtered by the year column
 * @method array findByEvaluationId(int $evaluation_id) Return EmpevalEmployeeEvaluations objects filtered by the evaluation_id column
 * @method array findByStatus(int $status) Return EmpevalEmployeeEvaluations objects filtered by the status column
 * @method array findByActive(boolean $active) Return EmpevalEmployeeEvaluations objects filtered by the active column
 * @method array findByLastModified(string $last_modified) Return EmpevalEmployeeEvaluations objects filtered by the last_modified column
 * @method array findByCreated(string $created) Return EmpevalEmployeeEvaluations objects filtered by the created column
 *
 * @package    propel.generator.empeval.om
 */
abstract class EmpevalBaseEmployeeEvaluationsQuery extends ModelCriteria
{
    /**
     * Initializes internal state of EmpevalBaseEmployeeEvaluationsQuery object.
     *
     * @param     string $dbName The dabase name
     * @param     string $modelName The phpName of a model, e.g. 'Book'
     * @param     string $modelAlias The alias for the model in this query, e.g. 'b'
     */
    public function __construct($dbName = 'vgp_empeval', $modelName = 'EmpevalEmployeeEvaluations', $modelAlias = null)
    {
        parent::__construct($dbName, $modelName, $modelAlias);
    }

    /**
     * Returns a new EmpevalEmployeeEvaluationsQuery object.
     *
     * @param     string $modelAlias The alias of a model in the query
     * @param     EmpevalEmployeeEvaluationsQuery|Criteria $criteria Optional Criteria to build the query from
     *
     * @return EmpevalEmployeeEvaluationsQuery
     */
    public static function create($modelAlias = null, $criteria = null)
    {
        if ($criteria instanceof EmpevalEmployeeEvaluationsQuery) {
            return $criteria;
        }
        $query = new EmpevalEmployeeEvaluationsQuery();
        if (null !== $modelAlias) {
            $query->setModelAlias($modelAlias);
        }
        if ($criteria instanceof Criteria) {
            $query->mergeWith($criteria);
        }

        return $query;
    }

    /**
     * Find object by primary key.
     * Propel uses the instance pool to skip the database if the object exists.
     * Go fast if the query is untouched.
     *
     * <code>
     * $obj  = $c->findPk(12, $con);
     * </code>
     *
     * @param mixed $key Primary key to use for the query
     * @param     PropelPDO $con an optional connection object
     *
     * @return   EmpevalEmployeeEvaluations|EmpevalEmployeeEvaluations[]|mixed the result, formatted by the current formatter
     */
    public function findPk($key, $con = null)
    {
        if ($key === null) {
            return null;
        }
        if ((null !== ($obj = EmpevalEmployeeEvaluationsPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {
            // the object is alredy in the instance pool
            return $obj;
        }
        if ($con === null) {
            $con = Propel::getConnection(EmpevalEmployeeEvaluationsPeer::DATABASE_NAME, Propel::CONNECTION_READ);
        }
        $this->basePreSelect($con);
        if ($this->formatter || $this->modelAlias || $this->with || $this->select
         || $this->selectColumns || $this->asColumns || $this->selectModifiers
         || $this->map || $this->having || $this->joins) {
            return $this->findPkComplex($key, $con);
        } else {
            return $this->findPkSimple($key, $con);
        }
    }

    /**
     * Find object by primary key using raw SQL to go fast.
     * Bypass doSelect() and the object formatter by using generated code.
     *
     * @param     mixed $key Primary key to use for the query
     * @param     PropelPDO $con A connection object
     *
     * @return   EmpevalEmployeeEvaluations A model object, or null if the key is not found
     * @throws   PropelException
     */
    protected function findPkSimple($key, $con)
    {
        $sql = 'SELECT USER_ID, BONUS_GOALS_FORM_ID, YEAR, EVALUATION_ID, STATUS, ACTIVE, LAST_MODIFIED, CREATED FROM employee_evaluations WHERE BONUS_GOALS_FORM_ID = :p0';
        try {
            $stmt = $con->prepare($sql);
            $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
            $stmt->execute();
        } catch (Exception $e) {
            Propel::log($e->getMessage(), Propel::LOG_ERR);
            throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);
        }
        $obj = null;
        if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
            $obj = new EmpevalEmployeeEvaluations();
            $obj->hydrate($row);
            EmpevalEmployeeEvaluationsPeer::addInstanceToPool($obj, (string) $key);
        }
        $stmt->closeCursor();

        return $obj;
    }

    /**
     * Find object by primary key.
     *
     * @param     mixed $key Primary key to use for the query
     * @param     PropelPDO $con A connection object
     *
     * @return EmpevalEmployeeEvaluations|EmpevalEmployeeEvaluations[]|mixed the result, formatted by the current formatter
     */
    protected function findPkComplex($key, $con)
    {
        // As the query uses a PK condition, no limit(1) is necessary.
        $criteria = $this->isKeepQuery() ? clone $this : $this;
        $stmt = $criteria
            ->filterByPrimaryKey($key)
            ->doSelect($con);

        return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
    }

    /**
     * Find objects by primary key
     * <code>
     * $objs = $c->findPks(array(12, 56, 832), $con);
     * </code>
     * @param     array $keys Primary keys to use for the query
     * @param     PropelPDO $con an optional connection object
     *
     * @return PropelObjectCollection|EmpevalEmployeeEvaluations[]|mixed the list of results, formatted by the current formatter
     */
    public function findPks($keys, $con = null)
    {
        if ($con === null) {
            $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
        }
        $this->basePreSelect($con);
        $criteria = $this->isKeepQuery() ? clone $this : $this;
        $stmt = $criteria
            ->filterByPrimaryKeys($keys)
            ->doSelect($con);

        return $criteria->getFormatter()->init($criteria)->format($stmt);
    }

    /**
     * Filter the query by primary key
     *
     * @param     mixed $key Primary key to use for the query
     *
     * @return EmpevalEmployeeEvaluationsQuery The current query, for fluid interface
     */
    public function filterByPrimaryKey($key)
    {

        return $this->addUsingAlias(EmpevalEmployeeEvaluationsPeer::BONUS_GOALS_FORM_ID, $key, Criteria::EQUAL);
    }

    /**
     * Filter the query by a list of primary keys
     *
     * @param     array $keys The list of primary key to use for the query
     *
     * @return EmpevalEmployeeEvaluationsQuery The current query, for fluid interface
     */
    public function filterByPrimaryKeys($keys)
    {

        return $this->addUsingAlias(EmpevalEmployeeEvaluationsPeer::BONUS_GOALS_FORM_ID, $keys, Criteria::IN);
    }

    /**
     * Filter the query on the user_id column
     *
     * Example usage:
     * <code>
     * $query->filterByUserId(1234); // WHERE user_id = 1234
     * $query->filterByUserId(array(12, 34)); // WHERE user_id IN (12, 34)
     * $query->filterByUserId(array('min' => 12)); // WHERE user_id > 12
     * </code>
     *
     * @see       filterByUsers()
     *
     * @param     mixed $userId The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalEmployeeEvaluationsQuery The current query, for fluid interface
     */
    public function filterByUserId($userId = null, $comparison = null)
    {
        if (is_array($userId)) {
            $useMinMax = false;
            if (isset($userId['min'])) {
                $this->addUsingAlias(EmpevalEmployeeEvaluationsPeer::USER_ID, $userId['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($userId['max'])) {
                $this->addUsingAlias(EmpevalEmployeeEvaluationsPeer::USER_ID, $userId['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(EmpevalEmployeeEvaluationsPeer::USER_ID, $userId, $comparison);
    }

    /**
     * Filter the query on the bonus_goals_form_id column
     *
     * Example usage:
     * <code>
     * $query->filterByBonusGoalsFormId(1234); // WHERE bonus_goals_form_id = 1234
     * $query->filterByBonusGoalsFormId(array(12, 34)); // WHERE bonus_goals_form_id IN (12, 34)
     * $query->filterByBonusGoalsFormId(array('min' => 12)); // WHERE bonus_goals_form_id > 12
     * </code>
     *
     * @see       filterByBonusGoalsForms()
     *
     * @see       filterByViewBgfWithSuperiorPositionId()
     *
     * @param     mixed $bonusGoalsFormId The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalEmployeeEvaluationsQuery The current query, for fluid interface
     */
    public function filterByBonusGoalsFormId($bonusGoalsFormId = null, $comparison = null)
    {
        if (is_array($bonusGoalsFormId) && null === $comparison) {
            $comparison = Criteria::IN;
        }

        return $this->addUsingAlias(EmpevalEmployeeEvaluationsPeer::BONUS_GOALS_FORM_ID, $bonusGoalsFormId, $comparison);
    }

    /**
     * Filter the query on the year column
     *
     * Example usage:
     * <code>
     * $query->filterByYear(1234); // WHERE year = 1234
     * $query->filterByYear(array(12, 34)); // WHERE year IN (12, 34)
     * $query->filterByYear(array('min' => 12)); // WHERE year > 12
     * </code>
     *
     * @param     mixed $year The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalEmployeeEvaluationsQuery The current query, for fluid interface
     */
    public function filterByYear($year = null, $comparison = null)
    {
        if (is_array($year)) {
            $useMinMax = false;
            if (isset($year['min'])) {
                $this->addUsingAlias(EmpevalEmployeeEvaluationsPeer::YEAR, $year['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($year['max'])) {
                $this->addUsingAlias(EmpevalEmployeeEvaluationsPeer::YEAR, $year['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(EmpevalEmployeeEvaluationsPeer::YEAR, $year, $comparison);
    }

    /**
     * Filter the query on the evaluation_id column
     *
     * Example usage:
     * <code>
     * $query->filterByEvaluationId(1234); // WHERE evaluation_id = 1234
     * $query->filterByEvaluationId(array(12, 34)); // WHERE evaluation_id IN (12, 34)
     * $query->filterByEvaluationId(array('min' => 12)); // WHERE evaluation_id > 12
     * </code>
     *
     * @see       filterByEvaluations()
     *
     * @param     mixed $evaluationId The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalEmployeeEvaluationsQuery The current query, for fluid interface
     */
    public function filterByEvaluationId($evaluationId = null, $comparison = null)
    {
        if (is_array($evaluationId)) {
            $useMinMax = false;
            if (isset($evaluationId['min'])) {
                $this->addUsingAlias(EmpevalEmployeeEvaluationsPeer::EVALUATION_ID, $evaluationId['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($evaluationId['max'])) {
                $this->addUsingAlias(EmpevalEmployeeEvaluationsPeer::EVALUATION_ID, $evaluationId['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(EmpevalEmployeeEvaluationsPeer::EVALUATION_ID, $evaluationId, $comparison);
    }

    /**
     * Filter the query on the status column
     *
     * Example usage:
     * <code>
     * $query->filterByStatus(1234); // WHERE status = 1234
     * $query->filterByStatus(array(12, 34)); // WHERE status IN (12, 34)
     * $query->filterByStatus(array('min' => 12)); // WHERE status > 12
     * </code>
     *
     * @param     mixed $status The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalEmployeeEvaluationsQuery The current query, for fluid interface
     */
    public function filterByStatus($status = null, $comparison = null)
    {
        if (is_array($status)) {
            $useMinMax = false;
            if (isset($status['min'])) {
                $this->addUsingAlias(EmpevalEmployeeEvaluationsPeer::STATUS, $status['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($status['max'])) {
                $this->addUsingAlias(EmpevalEmployeeEvaluationsPeer::STATUS, $status['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(EmpevalEmployeeEvaluationsPeer::STATUS, $status, $comparison);
    }

    /**
     * Filter the query on the active column
     *
     * Example usage:
     * <code>
     * $query->filterByActive(true); // WHERE active = true
     * $query->filterByActive('yes'); // WHERE active = true
     * </code>
     *
     * @param     boolean|string $active The value to use as filter.
     *              Non-boolean arguments are converted using the following rules:
     *                * 1, '1', 'true',  'on',  and 'yes' are converted to boolean true
     *                * 0, '0', 'false', 'off', and 'no'  are converted to boolean false
     *              Check on string values is case insensitive (so 'FaLsE' is seen as 'false').
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalEmployeeEvaluationsQuery The current query, for fluid interface
     */
    public function filterByActive($active = null, $comparison = null)
    {
        if (is_string($active)) {
            $active = in_array(strtolower($active), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
        }

        return $this->addUsingAlias(EmpevalEmployeeEvaluationsPeer::ACTIVE, $active, $comparison);
    }

    /**
     * Filter the query on the last_modified column
     *
     * Example usage:
     * <code>
     * $query->filterByLastModified('2011-03-14'); // WHERE last_modified = '2011-03-14'
     * $query->filterByLastModified('now'); // WHERE last_modified = '2011-03-14'
     * $query->filterByLastModified(array('max' => 'yesterday')); // WHERE last_modified > '2011-03-13'
     * </code>
     *
     * @param     mixed $lastModified The value to use as filter.
     *              Values can be integers (unix timestamps), DateTime objects, or strings.
     *              Empty strings are treated as NULL.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalEmployeeEvaluationsQuery The current query, for fluid interface
     */
    public function filterByLastModified($lastModified = null, $comparison = null)
    {
        if (is_array($lastModified)) {
            $useMinMax = false;
            if (isset($lastModified['min'])) {
                $this->addUsingAlias(EmpevalEmployeeEvaluationsPeer::LAST_MODIFIED, $lastModified['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($lastModified['max'])) {
                $this->addUsingAlias(EmpevalEmployeeEvaluationsPeer::LAST_MODIFIED, $lastModified['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(EmpevalEmployeeEvaluationsPeer::LAST_MODIFIED, $lastModified, $comparison);
    }

    /**
     * Filter the query on the created column
     *
     * Example usage:
     * <code>
     * $query->filterByCreated('2011-03-14'); // WHERE created = '2011-03-14'
     * $query->filterByCreated('now'); // WHERE created = '2011-03-14'
     * $query->filterByCreated(array('max' => 'yesterday')); // WHERE created > '2011-03-13'
     * </code>
     *
     * @param     mixed $created The value to use as filter.
     *              Values can be integers (unix timestamps), DateTime objects, or strings.
     *              Empty strings are treated as NULL.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalEmployeeEvaluationsQuery The current query, for fluid interface
     */
    public function filterByCreated($created = null, $comparison = null)
    {
        if (is_array($created)) {
            $useMinMax = false;
            if (isset($created['min'])) {
                $this->addUsingAlias(EmpevalEmployeeEvaluationsPeer::CREATED, $created['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($created['max'])) {
                $this->addUsingAlias(EmpevalEmployeeEvaluationsPeer::CREATED, $created['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(EmpevalEmployeeEvaluationsPeer::CREATED, $created, $comparison);
    }

    /**
     * Filter the query by a related EmpevalBonusGoalsForms object
     *
     * @param   EmpevalBonusGoalsForms|PropelObjectCollection $bonusGoalsForms The related object(s) to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   EmpevalEmployeeEvaluationsQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByBonusGoalsForms($bonusGoalsForms, $comparison = null)
    {
        if ($bonusGoalsForms instanceof EmpevalBonusGoalsForms) {
            return $this
                ->addUsingAlias(EmpevalEmployeeEvaluationsPeer::BONUS_GOALS_FORM_ID, $bonusGoalsForms->getId(), $comparison);
        } elseif ($bonusGoalsForms instanceof PropelObjectCollection) {
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }

            return $this
                ->addUsingAlias(EmpevalEmployeeEvaluationsPeer::BONUS_GOALS_FORM_ID, $bonusGoalsForms->toKeyValue('PrimaryKey', 'Id'), $comparison);
        } else {
            throw new PropelException('filterByBonusGoalsForms() only accepts arguments of type EmpevalBonusGoalsForms or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the BonusGoalsForms relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return EmpevalEmployeeEvaluationsQuery The current query, for fluid interface
     */
    public function joinBonusGoalsForms($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('BonusGoalsForms');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'BonusGoalsForms');
        }

        return $this;
    }

    /**
     * Use the BonusGoalsForms relation BonusGoalsForms object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   EmpevalBonusGoalsFormsQuery A secondary query class using the current class as primary query
     */
    public function useBonusGoalsFormsQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        return $this
            ->joinBonusGoalsForms($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'BonusGoalsForms', 'EmpevalBonusGoalsFormsQuery');
    }

    /**
     * Filter the query by a related EmpevalViewBgfWithSuperiorPositionId object
     *
     * @param   EmpevalViewBgfWithSuperiorPositionId|PropelObjectCollection $viewBgfWithSuperiorPositionId The related object(s) to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   EmpevalEmployeeEvaluationsQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByViewBgfWithSuperiorPositionId($viewBgfWithSuperiorPositionId, $comparison = null)
    {
        if ($viewBgfWithSuperiorPositionId instanceof EmpevalViewBgfWithSuperiorPositionId) {
            return $this
                ->addUsingAlias(EmpevalEmployeeEvaluationsPeer::BONUS_GOALS_FORM_ID, $viewBgfWithSuperiorPositionId->getId(), $comparison);
        } elseif ($viewBgfWithSuperiorPositionId instanceof PropelObjectCollection) {
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }

            return $this
                ->addUsingAlias(EmpevalEmployeeEvaluationsPeer::BONUS_GOALS_FORM_ID, $viewBgfWithSuperiorPositionId->toKeyValue('PrimaryKey', 'Id'), $comparison);
        } else {
            throw new PropelException('filterByViewBgfWithSuperiorPositionId() only accepts arguments of type EmpevalViewBgfWithSuperiorPositionId or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the ViewBgfWithSuperiorPositionId relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return EmpevalEmployeeEvaluationsQuery The current query, for fluid interface
     */
    public function joinViewBgfWithSuperiorPositionId($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('ViewBgfWithSuperiorPositionId');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'ViewBgfWithSuperiorPositionId');
        }

        return $this;
    }

    /**
     * Use the ViewBgfWithSuperiorPositionId relation ViewBgfWithSuperiorPositionId object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   EmpevalViewBgfWithSuperiorPositionIdQuery A secondary query class using the current class as primary query
     */
    public function useViewBgfWithSuperiorPositionIdQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        return $this
            ->joinViewBgfWithSuperiorPositionId($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'ViewBgfWithSuperiorPositionId', 'EmpevalViewBgfWithSuperiorPositionIdQuery');
    }

    /**
     * Filter the query by a related EmpevalUsers object
     *
     * @param   EmpevalUsers|PropelObjectCollection $users The related object(s) to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   EmpevalEmployeeEvaluationsQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByUsers($users, $comparison = null)
    {
        if ($users instanceof EmpevalUsers) {
            return $this
                ->addUsingAlias(EmpevalEmployeeEvaluationsPeer::USER_ID, $users->getId(), $comparison);
        } elseif ($users instanceof PropelObjectCollection) {
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }

            return $this
                ->addUsingAlias(EmpevalEmployeeEvaluationsPeer::USER_ID, $users->toKeyValue('PrimaryKey', 'Id'), $comparison);
        } else {
            throw new PropelException('filterByUsers() only accepts arguments of type EmpevalUsers or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the Users relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return EmpevalEmployeeEvaluationsQuery The current query, for fluid interface
     */
    public function joinUsers($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('Users');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'Users');
        }

        return $this;
    }

    /**
     * Use the Users relation Users object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   EmpevalUsersQuery A secondary query class using the current class as primary query
     */
    public function useUsersQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        return $this
            ->joinUsers($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'Users', 'EmpevalUsersQuery');
    }

    /**
     * Filter the query by a related EmpevalEvaluations object
     *
     * @param   EmpevalEvaluations|PropelObjectCollection $evaluations The related object(s) to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   EmpevalEmployeeEvaluationsQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByEvaluations($evaluations, $comparison = null)
    {
        if ($evaluations instanceof EmpevalEvaluations) {
            return $this
                ->addUsingAlias(EmpevalEmployeeEvaluationsPeer::EVALUATION_ID, $evaluations->getId(), $comparison);
        } elseif ($evaluations instanceof PropelObjectCollection) {
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }

            return $this
                ->addUsingAlias(EmpevalEmployeeEvaluationsPeer::EVALUATION_ID, $evaluations->toKeyValue('PrimaryKey', 'Id'), $comparison);
        } else {
            throw new PropelException('filterByEvaluations() only accepts arguments of type EmpevalEvaluations or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the Evaluations relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return EmpevalEmployeeEvaluationsQuery The current query, for fluid interface
     */
    public function joinEvaluations($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('Evaluations');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'Evaluations');
        }

        return $this;
    }

    /**
     * Use the Evaluations relation Evaluations object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   EmpevalEvaluationsQuery A secondary query class using the current class as primary query
     */
    public function useEvaluationsQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
    {
        return $this
            ->joinEvaluations($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'Evaluations', 'EmpevalEvaluationsQuery');
    }

    /**
     * Filter the query by a related EmpevalEmployeeEvaluationValues object
     *
     * @param   EmpevalEmployeeEvaluationValues|PropelObjectCollection $employeeEvaluationValues  the related object to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   EmpevalEmployeeEvaluationsQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByEmployeeEvaluationValues($employeeEvaluationValues, $comparison = null)
    {
        if ($employeeEvaluationValues instanceof EmpevalEmployeeEvaluationValues) {
            return $this
                ->addUsingAlias(EmpevalEmployeeEvaluationsPeer::BONUS_GOALS_FORM_ID, $employeeEvaluationValues->getBonusGoalsFormId(), $comparison);
        } elseif ($employeeEvaluationValues instanceof PropelObjectCollection) {
            return $this
                ->useEmployeeEvaluationValuesQuery()
                ->filterByPrimaryKeys($employeeEvaluationValues->getPrimaryKeys())
                ->endUse();
        } else {
            throw new PropelException('filterByEmployeeEvaluationValues() only accepts arguments of type EmpevalEmployeeEvaluationValues or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the EmployeeEvaluationValues relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return EmpevalEmployeeEvaluationsQuery The current query, for fluid interface
     */
    public function joinEmployeeEvaluationValues($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('EmployeeEvaluationValues');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'EmployeeEvaluationValues');
        }

        return $this;
    }

    /**
     * Use the EmployeeEvaluationValues relation EmployeeEvaluationValues object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   EmpevalEmployeeEvaluationValuesQuery A secondary query class using the current class as primary query
     */
    public function useEmployeeEvaluationValuesQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        return $this
            ->joinEmployeeEvaluationValues($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'EmployeeEvaluationValues', 'EmpevalEmployeeEvaluationValuesQuery');
    }

    /**
     * Exclude object from result
     *
     * @param   EmpevalEmployeeEvaluations $employeeEvaluations Object to remove from the list of results
     *
     * @return EmpevalEmployeeEvaluationsQuery The current query, for fluid interface
     */
    public function prune($employeeEvaluations = null)
    {
        if ($employeeEvaluations) {
            $this->addUsingAlias(EmpevalEmployeeEvaluationsPeer::BONUS_GOALS_FORM_ID, $employeeEvaluations->getBonusGoalsFormId(), Criteria::NOT_EQUAL);
        }

        return $this;
    }

}
